use Switch;

$var = 10;
@array = (10, 20, 30);
%hash = ('key1' => 10, 'key2' => 20);

switch(\@array){
   case 10           { print "number 10\n"; next; }
   case "a"          { print "string a\n"; }
   case (\@array)    { print "number in list (\@array)\n"; }
   case [1..10,42]   { print "number in list [1..10,42]\n"; }
   case (\%hash)     { print "entry in hash\n"; }
   else              { print "previous case not true\n"; }
}

switch($var){
   case 10           { print "number 10\n"; next; }
   case "a"          { print "string a\n"; }
   case (\@array)    { print "number in list (\@array)\n"; }
   case [1..10,42]   { print "number in list [1..10,42]\n"; }
   case (\%hash)     { print "entry in hash\n"; }
   else              { print "previous case not true\n"; }
}

switch(%hash){
   case 10           { print "number 10\n"; next; }
   case "a"          { print "string a\n"; }
   case (\@array)    { print "number in list (\@array)\n"; }
   case [1..10,42]   { print "number in list [1..10,42]\n"; }
   case (\%hash)     { print "entry in hash\n"; }
   else              { print "previous case not true\n"; }
}

print \@array,"\n";